const express=require('express');
const multer=require('multer');
const path=require('path');
const fs=require('fs');
// const bodyParser=require('body-parser');
const server=express();
// server.use(bodyParser.urlencoded())
var objMulter=multer({dest: './uploadImages'});
server.use(objMulter.any());

server.post('/infor',function(req,res,next){
    const newname=req.files[0].path+path.parse(req.files[0].originalname).ext
    fs.rename(req.files[0].path,newname,function(err){
        if(err){
            res.send('上传失败')
        }else{
            res.send('上传成功')
        }
    })
})
server.listen(8080);
